package com.quwan.common.enums;

/**
 * @author lt
 * @Date 2022/1/5 11:30 上午
 */
public enum SuggestionEnum {
    Block("Block", new Byte((byte)1)),// 建议屏蔽
    Review("Review", new Byte((byte)2)),// 建议人工复审
    Pass("Pass", new Byte((byte)3));// 建议通过

    private String msg;
    private Byte code;

    private SuggestionEnum(String msg, Byte code) {
        this.msg = msg;
        this.code = code;
    }
    public static String getMsgByCode(Byte code){
        SuggestionEnum[] enums = SuggestionEnum.values();
        for (SuggestionEnum suggestionEnum :enums){
            if(suggestionEnum.getCode().equals(code)){
                return suggestionEnum.getMsg();
            }
        }
        return "";
    }

    public static boolean isValidCode(Byte code) {
        for (SuggestionEnum suggestionEnum : SuggestionEnum.values()) {
            if (code.equals(suggestionEnum.getCode())) {
                return true;
            }
        }
        return false;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Byte getCode() {
        return code;
    }

    public void setCode(Byte code) {
        this.code = code;
    }
}
